package animator.phantom.renderer;

/*
    Copyright Janne Liljeblad

    This file is part of Phantom2D.

    Phantom2D is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Phantom2D is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Phantom2D.  If not, see <http://www.gnu.org/licenses/>.
*/



//--- A affine transformation as formatted in SVG files.
public class SVGAffineValue
{
	public double x = 0;
	public double y = 0;
	public double scaleX = 1;
	public double scaleY = 1;
	public double rotation = 0;
	public double skewX = 0;
	public double skewY = 0;

	public SVGAffineValue(){}

	//--- Adds two transforms together and returns result as new value. 
	public SVGAffineValue concatenate( SVGAffineValue c )
	{
		SVGAffineValue av = new SVGAffineValue();
		av.x = x + c.x;
		av.y = y + c.y;
		av.scaleX = scaleX * c.scaleX;
		av.scaleY = scaleY * c.scaleY;
		av.rotation = rotation + c.rotation;
		av.skewX = skewX + c.skewX;
		av.skewY = skewY + c.skewY;

		return av;
	}
	
}//end class
